package com.tsd.system.service;

import com.tsd.system.vo.VerifyCodeVo;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @ClassName: VerifyCodeGenService
 * @Description: 验证码生成、验证接口
 * @Author: Hillpool
 * @Date: 2021/1/8 15:30
 * @Version: 1.0
 */
public interface VerifyCodeGenService {

    /**
     * 生成验证码对象
     *
     * @param request
     * @return
     * @throws IOException
     */
    VerifyCodeVo generate(HttpServletRequest request) throws IOException;

    /**
     * 验证验证码
     *
     * @param code
     * @param request
     * @return
     */
    boolean verify(String code, HttpServletRequest request);

    /**
     * 验证验证码
     *
     * @param code
     * @param sessionId
     * @return
     */
    boolean verify(String code, String sessionId);
}
